<% include '/WEB-INF/includes/header.gtpl' %>

<div align="center">

	<%
		def blog = request.blog
	%>
	
	<table bgcolor="skyblue" width="900px">
	<tr>
	<td><h3>${blog.title}</h3></td>
	</tr>
	<tr>
	<td>${blog.content}</td>
	</tr>
	</table>
	
	<hr />
	<h2>留下评论：</h2>
	
	<%
		request.comments.each{ cmt ->
	%>
	
	<table width="400px">
	<tr>
	<td rowspan="2" >
	<img src="http://www.gravatar.com/avatar/${cmt.gravatarHash}?d=wavatar&s=45&r=g">
	</td>
	<td>
	<a href="/goto/${cmt.website}"><%= cmt.name == ""? "不愿意透露姓名的群众" : cmt.name %></a>
	<img src="/images/os/${cmt.os}.png">
	<img src="/images/browser/${cmt.browser}.png">
	</td>
	</tr>
	<tr>
	<td>于&nbsp;${cmt.pubTime}说:</td>
	</tr>
	<tr>
	<td colspan="2">${cmt.content}</td>
	</tr>
	</table><br />
	
	<%
		}
	%>
	
	<form action="/addcomment" method="post">
	
	<%
		def cookie = request.getCookies()
		if(cookie){
	%>
	姓名:<input type="text" name="name" value="${cookie[0].getValue()}" ><br />
	邮箱:<input type="text" name="email" value="${cookie[1].getValue()}" ><br />
	网站:<input type="text" name="website" value="${cookie[2].getValue()}" ><br />
	<%
	}else{
	%>
	姓名:<input type="text" name="name" ><br />
	邮箱:<input type="text" name="email" ><br />
	网站:<input type="text" name="website" ><br />
	<%
		}
	%>
	<input type="hidden" name="aId" value="${blog.key.id}">
	<textarea name="content" cols="50" rows="8" >说点什么...</textarea><br />
	
	<input type="submit" name="submit" value="提交评论"><br />
	</form>
	
</div>

<% include '/WEB-INF/includes/footer.gtpl' %>